package Enum;

/**
 * 作者:TC
 * 时间:2023/12/14 10:34
 * 描述:没有bug
 */
public class Testc {
    public static void main(String[] args) {
            int w = (int)(Math.random() * 7 + 1);

            String headfmt = "%-4s\t%-22s%s\t%s\n";

            System.out.printf(headfmt, "星期数值", "En名称", "Zh星期", "Zh周几");
            String fmt = "%-2d\t%-10s%s\t%s\n";//转数字
//            定义一个枚举类
            Weeks weeks = Weeks.values()[w - 1];
            System.out.printf(fmt, w, "\t"+weeks,
                    "\t\t\t"+weeks.getXingqi(), "\t周"+weeks.getZhou() );
        }
    }
